﻿using ImTools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace CheemsControl.Demo.Views.UserControl
{
    /// <summary>
    /// VirtualModelOfProductionLineWindow.xaml 的交互逻辑
    /// </summary>
    public partial class VirtualModelOfProductionLineWindow : Window
    {
        public VirtualModelOfProductionLineWindow()
        {
            InitializeComponent();
            Task.Run(async () =>
            {
                Application.Current.Dispatcher.Invoke(new Action(() =>
                {
                    this.VirtualModelOfProductionLine.Source = new Models.ProductionLineData()
                    {
                        minPosition = 500,
                        maxPosition = 1500,
                        reminderInformations = new List<Models.ReminderInformation>()
                {
                    new Models.ReminderInformation()
                    {
                        position = 800,
                        source = "D:/1.jpg",
                        tipType = Models.TipType.Warning
                    },
                    new Models.ReminderInformation()
                    {
                        position = 1200,
                        source = "D:/2.jpg",
                        tipType = Models.TipType.Alarm
                    },
                },
                    };
                }));

                //for (int i = 0; i < 100; i++)
                //{
                //    Application.Current.Dispatcher.Invoke(new Action(() => 
                //    {
                //        this.VirtualModelOfProductionLine.Source = new Models.ProductionLineData()
                //        {
                //            minPosition = 0 + i * 5,
                //            maxPosition = 1000 + i * 5,
                //            reminderInformations = new List<Models.ReminderInformation>()
                //{
                //    new Models.ReminderInformation()
                //    {
                //        position = 0 + i * 10,
                //        source = "D:/1.jpg",
                //        tipType = Models.TipType.Warning
                //    },
                //    new Models.ReminderInformation()
                //    {
                //        position = 30 + i * 10,
                //        source = "D:/2.jpg",
                //        tipType = Models.TipType.Alarm
                //    },
                //},
                //        };
                //    }));

                //    await Task.Delay(20);
                //}
            });
            

            
        }
    }
}
